package com.cryptoneedle.garden.vo;


import com.cryptoneedle.garden.enums.OdsTranslateType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>description: 标准表配置 </p>
 *
 * @author CryptoNeedle
 * @date 2025-09-26
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class OdsColumnTranslateVo {

    @NotBlank(message = "目录名称不能为空")
    @Schema(description = "目录名称")
    private String catalogName;

    @NotBlank(message = "库名称不能为空")
    @Schema(description = "库名称")
    private String databaseName;

    @NotBlank(message = "表名称不能为空")
    @Schema(description = "表名称")
    private String tableName;

    @NotBlank(message = "列名称不能为空")
    @Schema(description = "列名称")
    private String columnName;

    @NotEmpty(message = "翻译配置不能为空")
    @Schema(description = "翻译配置")
    private List<TranslateConfig> translateConfigs;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    @ToString
    public static class TranslateConfig {

        @NotBlank(message = "数据值不能为空")
        @Schema(description = "数据值")
        private String dataValue;

        @NotBlank(message = "翻译类型不能为空")
        @Schema(description = "翻译类型")
        private OdsTranslateType translateType;

        @NotBlank(message = "翻译值不能为空")
        @Schema(description = "翻译值")
        private String translateValue;

        @NotBlank(message = "顺序不能为空")
        @Schema(description = "顺序")
        private Integer sequence;
    }
}